home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / AppleScript / Additions / ACME Script Widgets 1.0 / Offset In List ƒ / Offset In List READ ME < prev    next >
Encoding:
Text File  |  1994-11-17  |  3.9 KB  |  115 lines  |  [ttro/ttxt]

  1.  
  2. ____________________________________________________
  3.  
  4.     Offset In List ver. 1.0
  5.  
  6.         Copyright (C) 1994 Wayne Walrath
  7.  
  8. ____________________________________________________
  9.  
  10. This software is free for personal use. To obtain a cheap and simple
  11. license for corporate, commercial or institutional use, contact the
  12. author at one of the addresses listed at the end of this document.
  13. THIS SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTIES. USE AT YOUR OWN
  14. RISK! You are encouraged to share this software with other people and
  15. to upload it to online services, but you may not charge money for it
  16. and you should only transfer the complete package. Contact me if you
  17. doubt whether you have a complete package. Inclusion on CD-ROMs
  18. requires explicit permission from me (the author).
  19.  
  20.  
  21. Offset In List is an AppleScript Scripting Addition (OSAX) which
  22. searches for an argument among the items of a list, returning either
  23. the item number where the target was found, or optionally, the next
  24. item in the list. Optional parameters allow you to specify case
  25. sensitivity and whether to allow partial matches.
  26.  
  27.  
  28. I'd like to thank David Jokinen of Ground Zero Software for generously creating
  29. an interesting sample script (Query) to show off the abilities of Offset In
  30. List, for coming up with the terminology "Offset In List" which is a lot nicer
  31. than what I was contemplating,   ;-)    and finally for all the excellent beta
  32. testing. Additionally, I want to thank Dennis Whiteman for being an all-around
  33. great beta tester. Quite a few other people have helped me test the ACME Script
  34. Widgets and I appreciate it. You know who you are.
  35.  
  36.  
  37. INSTALLATION:
  38. ______________________
  39. To install: Drag Offset In List to the Scripting Additions folder
  40. inside the Extensions folder.
  41.  
  42.  
  43.  
  44. USAGE:
  45. _______________
  46.  
  47. offset in list <list> of <string>    
  48.                 [ returning next item <bool> ]
  49.                 [ searching <even items/odd items/every item> ]
  50.                 [ case  <sensitive/insensitive> ]
  51.                 [ exact match <boolean> ]
  52.  
  53.  
  54. Considering the parameters in order, here's what they are for:
  55.  
  56. The direct parameter <list> is the list of items to search through.
  57.  
  58. <string> is the target to search for.
  59.  
  60. Returning... determines whether you want the item number where the
  61. target is found to be returned, or instead the next item after the
  62. item where target is found. Returning the offset is the default. The
  63. intended use for this option is in working with association lists
  64. (poor-man's records), where you have <key, value> pairs in a list.
  65.  
  66. Searching ... determines whether every item is searched or only even or
  67. odd items. If you are working with <key, value> pairs, you would only
  68. want to search odd items to avoid finding find the target in a value
  69. item instead of in a key item. Default is to search every item.
  70.  
  71. Case ... determines whether case is considered in the search. Sensitive is
  72. default.
  73.  
  74. Exact match... if this is set to true (default) the match must be exact
  75. (however, using the _case_ option modifies this behavior), if set to
  76. false, it will look for substring matches.
  77.  
  78.  
  79.  
  80.  
  81. EXAMPLES:
  82. _______________
  83.  
  84.     offset in list {"Apple", "Script"} of "apple"
  85.     => 0    -- not found because case sensitive search performed by default
  86.     
  87.     offset in list {"Apple", "Script"} of "apple" case insensitive
  88.     => 1    -- found in first element of list
  89.     
  90.     offset in list {"Apple", "Script"} of "Scr" exact match false
  91.     => 2    -- matched first three letters of second item
  92.     
  93.     offset in list {"Apple", "Script"} of "App" exact match false¬
  94.             returning next item true
  95.     => "Script"    -- matched first item and returned next item
  96.     
  97.     offset in list {"Apple", "Script"} of "App" exact match false¬
  98.             returning next item true searching even items
  99.     => ""    -- didn't match the first item because only even items searched
  100.  
  101.  
  102. ______________________
  103. Comments, bug reports and suggestions are welcomed.
  104.  
  105.  
  106.     ___________________________
  107.         Wayne Walrath
  108.         2010 Ravenswood Dr.
  109.         Evansville, IN 47714
  110.         (812) 476-8610
  111.         walrath@cs.indiana.edu
  112.         CIS: 70233,3151 
  113.     ___________________________
  114.  
  115.